From 443264ea123ca766a83a3cd37e25e23f171143f9 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 14 Dec 2016 11:44:36 +0000 Subject: [PATCH] libxl: init_acpi_config should return rc in exit path, and set to 0 on success init_acpi_config should return rc in exit path ... otherwise it returns 0 even if the function fails. Coverity-ID: 1397121 Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper Acked-by: Ian Jackson (cherry picked from commit 1361db0ed3ad1217bd039a3cac5df49a622e12a9) AND: set rc to 0 in init_acpi_config in success path xc_doamin_getinfo returns >=0 in success path, and if there is no vnode configured, that rc will be returned to caller, which indicates error. Fix that by setting rc to 0 in success path. Reported-by: Boris Ostrovsky Signed-off-by: Wei Liu Tested-by: Boris Ostrovsky (cherry picked from commit 08ccb46924385c833bd0da9e087fb6b96fa76849) Signed-off-by: Ian Jackson --- tools/libxl/libxl_x86_acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_x86_acpi.c b/tools/libxl/libxl_x86_acpi.c index ff0e2df3cb..b441adf7a4 100644 --- a/tools/libxl/libxl_x86_acpi.c +++ b/tools/libxl/libxl_x86_acpi.c @@ -152,8 +152,9 @@ static int init_acpi_config(libxl__gc *gc, config->lapic_base_address = LAPIC_BASE_ADDRESS; config->lapic_id = acpi_lapic_id; + rc = 0; out: - return 0; + return rc; } int libxl__dom_load_acpi(libxl__gc *gc, -- 2.30.2